// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 此处后端没有提供注释 POST /user/_batch */
export async function batch(body: API.UserEntity[], options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/user/_batch', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 DELETE /user/_delete/${param0} */
export async function deleteUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.deleteUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(`/user/_delete/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /user/_query */
export async function query(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseIPageUserEntity>('/user/_query', {
    method: 'GET',
    params: {
      ...params,
      queryParamEntity: undefined,
      ...params['queryParamEntity'],
    },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /user/_query/${param0} */
export async function queryById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryByIdParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseUserEntity>(`/user/_query/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /user/_save */
export async function save(body: API.UserEntity, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/user/_save', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 PUT /user/_update */
export async function update(body: API.UserEntity, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/user/_update', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /user/captcha */
export async function sendCaptcha(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sendCaptchaParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean>('/user/captcha', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /user/export */
export async function exportAllUser(options?: { [key: string]: any }) {
  return request<API.BaseResponseObject>('/user/export', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /user/get */
export async function getCurrentUser(options?: { [key: string]: any }) {
  return request<API.BaseResponseUserEntity>('/user/get', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /user/login */
export async function userLogin(body: API.UserLoginRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseString>('/user/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /user/login/captcha */
export async function fetchCaptchaToBase64(options?: { [key: string]: any }) {
  return request<API.BaseResponseLoginCaptchaVO>('/user/login/captcha', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /user/logout */
export async function userLogout(options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/user/logout', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 封禁用户 POST /user/ops */
export async function opsUserById(body: API.OpsUserRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/user/ops', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /user/query/page */
export async function queryUserByPage(
  body: API.QueryUserRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageUserEntity>('/user/query/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /user/register */
export async function userRegister(body: API.UserLoginRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/user/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
